package com.apexedu.portal.entity;

import javax.persistence.*;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 类别信息
 * Created by ly on 2014/8/7.
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "T_LBXX")
public class TLbxx implements Serializable {
    private String wid;
    private String upid; //上级id
    private String name; //名称
    private String des; //备注
    private String db; //数据源
    private String url; //地址
    private String sql; //查询sql
    private String state; //状态
    private Integer orderno; //排序值
    private String lx; //类型 字典表xxlb 1为待办 2为通知公告 3为其它
    private String moreurl; //更多链接地址
    /**
     * //业务系统地址
     */
    private String link;

    /**
     * 上级名称
     */
    private String upname;
    /**
     * 分类下的子信息
     */
    private List<TLbxx> lbxxList = new ArrayList<TLbxx>();

    @Id
    @Column(name = "WID")
    public String getWid() {
        return wid;
    }

    public void setWid(String wid) {
        this.wid = wid;
    }

    @Basic
    @Column(name = "UPID")
    public String getUpid() {
        return upid;
    }

    public void setUpid(String upid) {
        this.upid = upid;
    }

    @Basic
    @Column(name = "NAME")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "DES")
    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    @Basic
    @Column(name = "DB")
    public String getDb() {
        return db;
    }

    public void setDb(String db) {
        this.db = db;
    }

    @Basic
    @Column(name = "URL")
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Basic
    @Column(name = "SQL")
    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    @Basic
    @Column(name = "STATE")
    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Basic
    @Column(name = "ORDERNO")
    public Integer getOrderno() {
        return orderno;
    }

    public void setOrderno(Integer orderno) {
        this.orderno = orderno;
    }

    @Basic
    @Column(name = "LX")
    public String getLx() {
        return lx;
    }

    public void setLx(String lx) {
        this.lx = lx;
    }

    @Basic
    @Column(name = "MOREURL")
    public String getMoreurl() {
        return moreurl;
    }

    public void setMoreurl(String moreurl) {
        this.moreurl = moreurl;
    }

    @Transient
    public String getUpname() {
        return upname;
    }

    public void setUpname(String upname) {
        this.upname = upname;
    }

    @Transient
    public boolean isAdd() {
        return wid.length() == 1 && !"0".equals(wid);
    }

    @Override
    public String toString() {
        return "TLbxx{" +
                "wid='" + wid + '\'' +
                ", upid='" + upid + '\'' +
                ", name='" + name + '\'' +
                ", des='" + des + '\'' +
                ", db='" + db + '\'' +
                ", url='" + url + '\'' +
                ", sql='" + sql + '\'' +
                ", state='" + state + '\'' +
                ", orderno=" + orderno +
                ", lx='" + lx + '\'' +
                '}';
    }

    @Transient
    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    @Transient
    public List<TLbxx> getLbxxList() {
        return lbxxList;
    }

    public void setLbxxList(List<TLbxx> lbxxList) {
        this.lbxxList = lbxxList;
    }
}
